package it.canraid.shapefile;

import java.util.List;

public class EDbfComuni2011 {
	public String[] nameColumn=null;
	public byte[] typeColumn=null;
	public List<List<Object>> matrix =null;
	
	public EDbfComuni2011(com.bbn.openmap.dataAccess.shape.input.DbfInputStream ffdbf){
		typeColumn=ffdbf.getTypes();
		nameColumn=ffdbf.getColumnNames();
		matrix= ffdbf.getRecords();
	}
	
	public Row getRow(int index){
		if (index >= matrix.size())
			return null;
		
		List<Object> row=matrix.get(index);
		return new Row(row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5), row.get(6));
	}
	
	public class Row{
		public int c_1=-1;
		public int c_2=-1;
		public int c_3=-1;
		public int c_4=-1;
		public String c_5="";
		public double c_6=-1;
		public double c_7=-1;
		
		public Row(Object c_1, Object c_2, Object c_3, Object c_4, Object c_5, Object c_6, Object c_7) {
			double c_1_d=(Double)c_1;
			double c_2_d=(Double)c_2;
			double c_3_d=(Double)c_3;
			double c_4_d=(Double)c_4;
			this.c_1 = (int)c_1_d;
			this.c_2 = (int)c_2_d;
			this.c_3 = (int)c_3_d;
			this.c_4 = (int)c_4_d;
			this.c_5 = (String)c_5;
			this.c_6 = (Double)c_6;
			this.c_7 = (Double)c_7;
		}
	}

}
